#ifndef SPI_H
#define SPI_H

#include <QObject>
#include <QFile>

class Spi : public QObject
{
   Q_OBJECT

public:
   explicit Spi(quint32 spiDevice,
                QObject *parent = 0);

   bool openPort();
   void closePort();
   bool transfer(QByteArray *data);

protected:
   QFile theSpiDevice;

   static const QString SPI_DEVICE_FILE;
   static const quint32 SPI_MODE;
   static const quint32 BITS_PER_WORD;
   static const quint32 BITS_PER_SEC;
};

#endif // SPI_H
